package net.yeah.mickey_zhouyou.database.util;

import java.util.Map.Entry;

import junit.framework.Assert;
import net.yeah.mickey_zhouyou.database.domain.BaseEntity;
import net.yeah.mickey_zhouyou.database.domain.BaseRelationship;

import org.junit.Test;

public class GenericReflectionUtilTest {

	@Test
	public void test1() {
		Entry<Class<?>, Class<?>> e = GenericReflectionUtil
				.getRelationshipGenericTypes(R.class);

		Assert.assertEquals(e.getKey().getName(),
				"net.yeah.mickey_zhouyou.database.util.GenericReflectionUtilTest$D");
		Assert.assertEquals(e.getValue().getName(),
				"net.yeah.mickey_zhouyou.database.util.GenericReflectionUtilTest$C");
	}

	class C extends BaseEntity {

		@Override
		public int compare(BaseEntity o1, BaseEntity o2) {
			// TODO Auto-generated method stub
			return 0;
		}

	}

	class B extends BaseEntity {

		@Override
		public int compare(BaseEntity o1, BaseEntity o2) {
			// TODO Auto-generated method stub
			return 0;
		}

	}

	class D extends B {

	}

	class R extends BaseRelationship<D, C> {

		public R(D e1, C e2) {
			super(e1, e2);
		}

	}

}